﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class ProvinceSelectCommandHandler : IRequestHandler<ProvinceSelectCommand, List<ProvinceInfo>>
    {
        private readonly IProvinceService provinceService;

        public ProvinceSelectCommandHandler(IProvinceService provinceService)
        {
            this.provinceService = provinceService;
        }

        public async Task<List<ProvinceInfo>> Handle(ProvinceSelectCommand request, CancellationToken cancellationToken)
        {
            return await provinceService.GetProvinceInfo();
        }
    }
}
